package com.keyancompany.zhongbaopingtai.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.keyancompany.zhongbaopingtai.R;
import com.keyancompany.zhongbaopingtai.model.CircleDetailModel;
import com.keyancompany.zhongbaopingtai.model.User;

import java.util.List;

/**
 * Created by firefox on 2017/4/13.
 */

public class MemberAdapter extends ListAdapter<User> {

    public MemberAdapter(List items, Context ctx) {
        super(items, ctx);
    }

    @Override
    public int getContentViewId() {
        return R.layout.item_user_icon;
    }

    @Override
    public HolderView getHoldView(int position, View contentView, ViewGroup parent) {
        return new IconHolder(contentView);
    }

    @Override
    public void setItemView(int position, HolderView contentView, User item) {

        IconHolder hold = (IconHolder) contentView;
        hold.name.setText(item.getUsername());
    }


    class IconHolder extends ListAdapter.HolderView {
        TextView name;

        public IconHolder(View view) {
            name = (TextView) view.findViewById(R.id.name);
        }
    }

}
